home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d17 / swplpt_c.arc / SWAPLPTS.C < prev    next >
C/C++ Source or Header  |  1991-04-12  |  751b  |  29 lines

  1. /*
  2.  *  S W A P L P T S . C
  3.  *
  4.  *  COPYRIGHT (C) 1991 JOHN W GROTHMAN.  ALL RIGHTS RESERVED.
  5.  *
  6.  *  purpose:
  7.  *        Swap LPT1 and LPT2.
  8.  *
  9.  *  to do:
  10.  *
  11.  *  technical notes:
  12.  *        This is a SIMPLE thing to do.  Just swap the base I/O addresses
  13.  *        in low DOS memory that DOS uses to map the LPT port hardware.
  14.  *
  15.  *  modification log:
  16.  *    1.0        4/12/90        John W Grothman
  17.  */
  18.  
  19. void main()
  20. {
  21.   int far        *lptr1 = (int far *)0x0408; /* Pointer to address of LPT1 */
  22.   int far        *lptr2 = (int far *)0x040A; /* Pointer to address of LPT2 */
  23.   unsigned int    lptbuf;
  24.  
  25.     lptbuf = *lptr1;                /* Save LPT1's base I/O address */
  26.     *lptr1 = *lptr2;                /* Put LPT2's base addr into LPT1 */
  27.     *lptr2 = lptbuf;                /* Put LPT1's base addr into LPT2 */
  28. }
  29.